<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>九九乘法表</title>
    <style>
        html{
            font-family: monospace;
        }
    </style>
    <script>
        // 格式1
        for(i=1;i<=9;i++){
            for(j=1;j<=i;j++){
                document.write(j+"*"+i+"="+i*j+(i*j<10?"&nbsp&nbsp&nbsp":"&nbsp&nbsp")); 
            }
            document.write('<br>');
        }
        document.write('<br>');
        document.write('<br>');
        document.write('<br>');
        // 格式2
        for(i=9;i>=1;i--){
            for(j=1;j<=i;j++){
                document.write(j+"*"+i+"="+i*j+(i*j<10?"&nbsp&nbsp&nbsp":"&nbsp&nbsp")); 
            }
            document.write('<br>');
        }
        // 格式3
        document.write('<br>');
        document.write('<br>');
        document.write('<br>');
        // document.write('<table>');
        for(var i=1;i<=9;i++){
            // document.write('<tr>')
                for(var k=1;k<=9-i;k++){
                    // document.write('<td>')
                        document.write('&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp')
                        // document.write('</td>')
                    }
                    for(var j=1;j<=i;j++){
                        // document.write('<td>')
                        document.write(j+"*"+i+"="+i*j+(i*j<10?"&nbsp&nbsp&nbsp":"&nbsp&nbsp"))
                        // document.write('</td>')
                    }
                document.write("<br>");
            // document.write('</tr>')     
        }
        // document.write('</table>');
        // 格式4
        document.write('<br>');
        document.write('<br>');
        document.write('<br>');
        // document.write('<table>');
        for(var i=9;i>=1;i--){
            // document.write('<tr>')
                for(var k=1;k<=9-i;k++){
                    // document.write('<td>')
                        document.write('&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp')
                        // document.write('</td>')
                    }
                    for(var j=1;j<=i;j++){
                        // document.write('<td>')
                        document.write(j+"*"+i+"="+i*j+(i*j<10?"&nbsp&nbsp&nbsp":"&nbsp&nbsp"))
                        // document.write('</td>')
                    }
                document.write("<br>");
            // document.write('</tr>')     
        }
        // document.write('</table>');
    </script>
</head>
<body>
<table>
    <tr>
        <td></td>
    </tr>
</table>
</body>
</html>